package svc

import (
	"activity_srv/activityclient"
	"github.com/zeromicro/go-zero/zrpc"
	"homepage_srv/homepageclient"
	"order_srv/internal/config"
	"user_srv/userclient"
)

type ServiceContext struct {
	Config      config.Config
	HomePage    homepageclient.Homepage
	UserSrv     userclient.User
	ActivitySrv activityclient.Activity
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:      c,
		HomePage:    homepageclient.NewHomepage(zrpc.MustNewClient(c.HomePage)),
		UserSrv:     userclient.NewUser(zrpc.MustNewClient(c.UserSrv)),
		ActivitySrv: activityclient.NewActivity(zrpc.MustNewClient(c.ActivitySrv)),
	}
}
